<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8">

		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
		Remove this if you use the .htaccess -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

		<title>ajax2</title>
		<meta name="description" content="">
		<meta name="author" content="HongJP">

		<meta name="viewport" content="width=device-width; initial-scale=1.0">

		<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
		<link rel="shortcut icon" href="/favicon.ico">
		<link rel="apple-touch-icon" href="/apple-touch-icon.png">
	</head>

	<body>
		
		<form id = "form1">
			
			<input type= 'text' name='v1' value='AAAA'>
			<br/>
			<input type='text' name='v2' value='BBBB'>
			<input type='checkbox' name='t' value="t">
			<input type='checkbox' name='t' value="c" checked="cheked">
			<input type='checkbox' name='t' value="w">
			
			
			<span id='btn'>CLICK </span>
		</form>
		
		
		  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
	<script src="js/json2.js"></script>
	<script>

		$('#btn').bind("click", function(event){    //bind는 addeventListener
			var obj = $('#form1').serializeArray();
			//ajax 호출
			//$get
			//$ajax
			console.log(JSON.stringify(obj));
			
		
			
			
			
			
			
			
		});
		
		
	/*
		
			$.get("quiz.html",function(data) {
				console.log(data);
				var obj = JSON.parse(data);
				
				console.log(obj.title);
				console.log(obj.content);
				
			});*/
	
		
		
		
			$.ajax({
					type:"get",
					url:"quiz.json",
					dataType:"json",
					success:function(data) {
						var obj = JSON.parse(data);
						console.log(obj);
					}
					
				});
		

	</script>
	</body>
</html>
